package com.mongoosehome.web.base;

import com.mongoosehome.web.util.BaseResource;
import java.util.List;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.Logger;

/**
 * 资源加载。
 *
 */
public class ResourceLoad extends HttpServlet {

    private static final long serialVersionUID = 1L;
    private static Logger logger = Logger.getLogger(ResourceLoad.class);

    @Override
    public void init(ServletConfig arg0) throws ServletException {
        super.init(arg0);
        try {
            String appPath = this.getServletContext().getRealPath("");
            //加载系统 XML配置文件
            BaseResource.initGlobals(appPath + "/WEB-INF/config/SystemGlobals.xml");
            logger.info(" servlet init ok ");
        } catch (Exception e) {
            throw new ServletException("系统初始化错误", e);
        }
    }  
  
}
